﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using MCMLXVII.BackEnd.Services.OrganizationChart.Messages;
using MCMLXVII.BackEnd.Services.Common.Messages;
using MCMLXVII.BackEnd.Services.SystemConfiguration.Messages;
using MCMLXVII.Core.Common;
using MCMLXVII.BackEnd.Services.SessionManagement.Messages;

namespace MCMLXVII.BackEnd.Services.WCFService
{
    [ServiceContract(SessionMode=SessionMode.Required)]
    public interface IBusinessActions
    {        
        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgNewSessionResponse GetNewSession(msgNewSessionRequest req);

        [OperationContract]        
        [FaultContract(typeof(BackendFault))]
        msgOrganizationNodeInfo GetOrganizationTree(msgVoidRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgOrganizationNodeInfo GetOrganizationDestinationTree(msgSimpleNodeRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgOrganizationTreeNodeMember> GetOrganizationTreeNodeMembers(msgSimpleNodeRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<int> UpdateOrganizationTreeNode(msgUpdateOrganizationTreeNode req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<int> MoveOrganizationTreeNode(msgMoveNodeRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<int> MoveOrganizationMember(msgMoveMemberRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<int> UpdateOrganizationMember(msgUpdateOrganizationMember req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<bool> DeleteOrganizationTreeNode(msgSimpleNodeRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<bool> DeleteOrganizationMember(msgSimpleMemberRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgOrganizationMemberInfo GetOrganizationMemberInfo(msgSimpleMemberRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<string> GetOrganizationTreeNodeEfectiveRights(msgSimpleNodeRequest NodeID);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgOrganizationNodeAuditInfo> GetOrganizationTreeNodeAudit(msgSimpleNodeRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgOrganizationMemberAuditInfo> GetOrganizationMemberAudit(msgSimpleMemberRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgXMLResponse GetDirectoryTree(msgGenericItemRequest<int> req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgXMLResponse GetDirectoryNodeUsers(msgSecurityUsersListRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgXMLResponse GetDirectoryNodeGroups(msgSecurityUsersListRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgMembershipInfo> GetOrganizationTreeMembers(msgFindMembersRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgMembershipInfo> GetOrganizationTreeRoleMembers(msgFindMembersRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgMembershipInfo GetOrganizationTreeMemberDesc(msgGenericItemRequest<int> req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgLanguajesListResponse GetContentLanguagesList(msgGenericItemRequest<bool> req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<string> GetDefaultLanguage(msgVoidRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgNewOrganizationTreeItemResponse CreateNewOrganizationTreeNode(msgNewOrganizationTreeNode req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgNewOrganizationTreeItemResponse CreateNewOrganizationMember(msgNewOrganizationMember req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgOrganizationTreeMembersClass> GetOrganizationTreeMembersClasses(msgVoidRequest req);
        
        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgBasicOrganizationMemberInfo> FindorganizationMembersByDescription(msgGenericItemRequest<string> req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgOrganizationTreeNodeSecurity GetOrganizationTreeNodeSecurity(msgSimpleNodeRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<int> UpdateOrganizationTreeNodeSecurity(msgUpdateOrganizationTreeNodeSecurity req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgSecurityProvider> GetEnabledSecurityProviders(msgVoidRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgToolsInfo> GetToolsList(msgVoidRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgToolsInfo GetToolInfo(msgGenericItemRequest<string> req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgPermissionInfo> GetPermissionsList(msgVoidRequest req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgPermissionInfo> GetMemberPermissionsList(msgGenericItemRequest<int> req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemList<msgPermissionInfo> GetMemberInheritedPermissionsList(msgGenericItemRequest<int> req);

        [OperationContract]
        [FaultContract(typeof(BackendFault))]
        msgGenericItemResponse<int> UpdateMemberPermissions(msgMemberPermissionInfo req);
    }
}
